<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/tagDeclare.jsp"%>
<%@include file="/headDeclare.jsp"%>
<html>
<head>
	<style type="text/css"> 
	  fieldset,legend,form,table,tr,td,textarea{margin:0;padding:0}
	  form label {font-weight:bold;}
	  table{margin:10px 10px};
	  td{line-height: 40px;}
	  input[type="text"]{width:250px;}
	  input[type="password"]{width:250px;}
	  input[type="textarea"]{width:250px;}
	</style>

	<script type="text/javascript">
	  $(document).ready(function(){
		  
			//文件上传组件
		     $("#file_upload").uploadify({   
               'height'        : 27,    
 	          'width'         : 80,     
 	          'buttonText'    : '添加照片',   
 	          'queueID': 'fileQueue', 
 	          'removeCompleted': false,         //上传完毕上传列表是否去除 
 	          'fileSizeLimit': '20MB',          //上传文件大小设置 单位可以是B、KB、MB、GB 
               'swf'           : 'js/uploadify/uploadify.swf',   
 	          'uploader'      : '<%=basePath%>batchUpload.do',   
 	          'auto'          : false,   
 	          'fileTypeExts'  : '*.jpg;*.png;*.gif',   
 	          'multi'			: true,
 	          'onUploadStart' : function(file) {   
 	                $("#file_upload").uploadify("settings");   
 	           },   
 	          'onUploadSuccess':function(file, data, response){ 
 	        	 var json=eval("("+data+")"); //转换为json对象
	        	  $('#' + file.id).find('.data').html(json.msg);
 	           }
		      });
		  
		    
	   });
	  
	  function startUpload(){
		  $('#file_upload').uploadify('upload','*');   
	   }  
	 
	</script>
</head>
<body>

	
	<div id="uploadDiv"  >
		<fieldset>
		   <legend>上传附件：<label style="color: red;">*文件命名规则为：姓名@联系方式@XX.jpg</label></legend>
		   <input type="file" name="uploadify" id="file_upload" />   
		   
		   <label id="fileQueue" ></label>
		   <hr>   
           <a onclick="startUpload();" href="javascript:void(0);">开始上传</a>    
           <a href="javascript:$('#file_upload').uploadify('cancel', '*')" >取消所有上传</a>   
        </fieldset>
    </div>
	
	
</body>
</html>